package com.jeeplus.modules.common.excel.common.validator.abs;

import org.apache.poi.ss.formula.functions.T;

import java.lang.reflect.Field;

/**
 * 用户自定义的校验器，校验数据
 *
 */
public abstract class AbstractCustomValidator<T> extends AbstractValidator{
    @Override
    public boolean canValidate(Field field) {
        return true;
    }

    @Override
    public String toValidate(Object entity, Field field) {
        return this.customValidate((T) entity);
    }

    /**
     * 自定义的校验
     * @param entity
     * @return
     */
    public abstract String customValidate(T entity);

}
